home *** CD-ROM | disk | FTP | other *** search
/ Skunkware 5 / Skunkware 5.iso / man / cat.3 / DetachPids.3 < prev    next >
Encoding:
Text File  |  1995-07-26  |  5.3 KB  |  133 lines

  1.  
  2.  
  3.  
  4.      TTTTccccllll____DDDDeeeettttaaaacccchhhhPPPPiiiiddddssss((((3333))))            TTTTccccllll (((( ))))            TTTTccccllll____DDDDeeeettttaaaacccchhhhPPPPiiiiddddssss((((3333))))
  5.  
  6.  
  7.  
  8.      _________________________________________________________________
  9.  
  10.      NNNNAAAAMMMMEEEE
  11.           Tcl_DetachPids,   Tcl_ReapDetachedProcs   -   manage   child
  12.           processes in background
  13.  
  14.      SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  15.           ####iiiinnnncccclllluuuuddddeeee <<<<ttttccccllll....hhhh>>>>
  16.  
  17.           TTTTccccllll____DDDDeeeettttaaaacccchhhhPPPPiiiiddddssss(_n_u_m_P_i_d_s, _p_i_d_P_t_r)
  18.  
  19.           TTTTccccllll____RRRReeeeaaaappppDDDDeeeettttaaaacccchhhheeeeddddPPPPrrrrooooccccssss()                                       |
  20.  
  21.      AAAARRRRGGGGUUUUMMMMEEEENNNNTTTTSSSS
  22.           int   _n_u_m_P_i_d_s      (in)      Number of process ids contained
  23.                                        in  the  array  pointed  to  by
  24.                                        _p_i_d_P_t_r.
  25.  
  26.           int   *_p_i_d_P_t_r      (in)      Address  of  array   containing
  27.                                        _n_u_m_P_i_d_s process ids.
  28.      _________________________________________________________________
  29.  
  30.  
  31.      DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  32.           TTTTccccllll____DDDDeeeettttaaaacccchhhhPPPPiiiiddddssss and TTTTccccllll____RRRReeeeaaaappppDDDDeeeettttaaaacccchhhheeeeddddPPPPrrrrooooccccssss provide a mechanism  |
  33.           for  managing  subprocesses  that are running in background.  |
  34.           These procedures are needed because the parent of a  process  |
  35.           must  eventually invoke the wwwwaaaaiiiittttppppiiiidddd kernel call (or one of a  |
  36.           few other similar kernel calls) to wait  for  the  child  to  |
  37.           exit.   Until  the  parent  waits for the child, the child's  |
  38.           state cannot be completely reclaimed by the  system.   If  a  |
  39.           parent  continually  creates  children  and  doesn't wait on  |
  40.           them, the system's process table will  eventually  overflow,  |
  41.           even if all the children have exited.                         |
  42.  
  43.           TTTTccccllll____DDDDeeeettttaaaacccchhhhPPPPiiiiddddssss  may  be  called   to   ask   Tcl   to   take  |
  44.           responsibility  for  one or more processes whose process ids  |
  45.           are contained in the _p_i_d_P_t_r array passed as  argument.   The  |
  46.           caller  presumably  has  started  these processes running in  |
  47.           background and doesn't want to have to deal with them again.  |
  48.  
  49.           TTTTccccllll____RRRReeeeaaaappppDDDDeeeettttaaaacccchhhheeeeddddPPPPrrrrooooccccssss invokes the  wwwwaaaaiiiittttppppiiiidddd  kernel  call  on  |
  50.           each  of  the  background processes so that its state can be  |
  51.           cleaned up if it has exited.  If the process  hasn't  exited  |
  52.           yet,  TTTTccccllll____RRRReeeeaaaappppDDDDeeeettttaaaacccchhhheeeeddddPPPPrrrrooooccccssss doesn't wait for it to exit;  it  |
  53.           will  check  again  the  next  time  it  is  invoked.    Tcl  |
  54.           automatically calls TTTTccccllll____RRRReeeeaaaappppDDDDeeeettttaaaacccchhhheeeeddddPPPPrrrrooooccccssss each time the eeeexxxxeeeecccc  |
  55.           command is executed, so in most cases it isn't necessary for  |
  56.           any  code  outside  of  Tcl to invoke TTTTccccllll____RRRReeeeaaaappppDDDDeeeettttaaaacccchhhheeeeddddPPPPrrrrooooccccssss.  |
  57.           However, if you call TTTTccccllll____DDDDeeeettttaaaacccchhhhPPPPiiiiddddssss in situations where  the  |
  58.           eeeexxxxeeeecccc  command  may  never get executed, you may wish to call  |
  59.           TTTTccccllll____RRRReeeeaaaappppDDDDeeeettttaaaacccchhhheeeeddddPPPPrrrrooooccccssss from time to time so  that  background  |
  60.  
  61.  
  62.  
  63.      Page 1                                          (printed 7/10/95)
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.      TTTTccccllll____DDDDeeeettttaaaacccchhhhPPPPiiiiddddssss((((3333))))            TTTTccccllll (((( ))))            TTTTccccllll____DDDDeeeettttaaaacccchhhhPPPPiiiiddddssss((((3333))))
  71.  
  72.  
  73.  
  74.           processes can be cleaned up.
  75.  
  76.  
  77.      KKKKEEEEYYYYWWWWOOOORRRRDDDDSSSS
  78.           background, child, detach, process, wait
  79.  
  80.  
  81.  
  82.  
  83.  
  84.  
  85.  
  86.  
  87.  
  88.  
  89.  
  90.  
  91.  
  92.  
  93.  
  94.  
  95.  
  96.  
  97.  
  98.  
  99.  
  100.  
  101.  
  102.  
  103.  
  104.  
  105.  
  106.  
  107.  
  108.  
  109.  
  110.  
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.      Page 2                                          (printed 7/10/95)
  130.  
  131.  
  132.  
  133.